package hsrt.com.dynamiccomponent_android;

import android.widget.Switch;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.chad.library.adapter.base.entity.MultiItemEntity;

import java.lang.ref.WeakReference;

import hsrt.com.dynamiccomponent_android.dynamic_component.DynamicComponentInterface;
import hsrt.com.dynamiccomponent_android.dynamic_component.DynamicDisplayManager;

public class Component2 implements DynamicComponentInterface {
    private WeakReference<DynamicDisplayManager> managerWeakReference;

    @Override
    public void setDynamicManager(DynamicDisplayManager manager) {
        managerWeakReference = new WeakReference<>(manager);
    }

    @Override
    public Integer registerName() {
        return R.layout.layout2;
    }


    @Override
    public void process(BaseViewHolder holder, MultiItemEntity item, BaseQuickAdapter adapter, boolean flagModify) {


        Switch switcher = holder.getView(R.id.switch1);
        switcher.setChecked(true);
    }
}
